home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / fm2utils.zip / unlzher.cmd < prev    next >
OS/2 REXX Batch file  |  1996-12-22  |  946b  |  32 lines

  1. /*
  2.  * Unlzh to directory in which file resides (for WPS drag-and-drop)
  3.  * Must pass fully qualified name of lzh file (d&d does)
  4.  */
  5. arg filename
  6. if length(filename) < 2 then exit
  7. call setlocal
  8. pathname = filename
  9. pathname = left(pathname,lastpos('\',pathname))
  10. if pathname = '' then
  11. do
  12.   say 'Pass the fully qualified pathname of the file, please.'
  13.   exit
  14. end
  15. if substr(pathname, length(pathname) - 1, 1) \= ':' then
  16. do
  17.   pathname = left(pathname,length(pathname) - 1)
  18. end
  19. call directory pathname
  20. say '['directory()'] lh x /a /s /o /e 'filename
  21. /*
  22.  * modify this line if lh not on PATH or is named something
  23.  * besides lh.exe, or to add or remove command line switches
  24.  */
  25. 'lh /a /s /o /e 'filename
  26. /* open the folder where the file was just unlzhed */
  27. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  28. call SysLoadFuncs
  29. call SysSetObjectData directory(), "OPEN=DEFAULT"
  30. call endlocal
  31. /* Hector wuz here */
  32.